import { baseUrlApi, requestClient, type Result } from '#/api/request';

/** 获取档案列表 */
export const getInitialcheckup = (params?: object) => {
  return requestClient.get<Result>(baseUrlApi('/preg/admin/initialcheckup'), {
    params,
  });
};

/** 获取选择档案列表 */
export const getInitialcheckupSelect = (params?: object) => {
  return requestClient.get<Result>(
    baseUrlApi('/preg/admin/initialcheckup/select/data'),
    {
      params,
    },
  );
};

/** 添加 */
export const postInitialcheckup = (data?: object) => {
  return requestClient.put<Result>(
    baseUrlApi('/preg/admin/initialcheckup'),
    data,
  );
};

/** 获取信息 */
export const getInitialcheckupInfo = (data: { id: number }) => {
  return requestClient.get<Result>(
    baseUrlApi(`/preg/admin/initialcheckup/${data.id}`),
  );
};

/** 编辑 */
export const putInitialcheckup = (data?: any) => {
  return requestClient.put<Result>(
    baseUrlApi(`/preg/admin/initialcheckup/${data.id}`),
    {
      data,
    },
  );
};

/** 删除 */
export const deleteInitialcheckup = (id: number) => {
  return requestClient.delete<Result>(
    baseUrlApi(`/preg/admin/initialcheckup/${id}`),
  );
};

/** 设置显示状态 */
export const postInitialcheckupStatus = (data?: {
  id?: number;
  ids?: object;
  type: string;
}) => {
  return requestClient.put<Result>(
    baseUrlApi(`/preg/admin/initialcheckup/status`),
    {
      data,
    },
  );
};

/** 获取列表 */
export const getInitialcheckupSelectData = () => {
  return requestClient.get<Result>(
    baseUrlApi('/preg/admin/initialcheckup/select/data'),
  );
};
